const app = getApp();
Component({
    data: {
        navIndex: 1,
        bottomLift: app.globalData.bottomLift,
    },
    properties: {
        index: {
            type: Number,
            value: 1,
            observer: function (val) {
                this.setData({
                    navIndex: val,
                });
            }
        }
    },
    lifetimes: {
        attached() {
          // console.log(this.data.bottomLift,'bottomLift');
        },
        detached() { }
    },
    methods: {
        //图标点击事件
        navClick(e) {
            const index = e.currentTarget.dataset.index;
            this.setData({ navIndex: index });
            this.triggerEvent("footerEvent", index);
        },
        //发布点击事件
        fabunavClick() {
            let url = null;
            this.data.navIndex === 2 ? url = '/pagesLuxian/pages/guiHua/index' : url = '/pagesFaBu/pages/index/index';
            wx.navigateTo({
                url: url,
            });
        },
    }
})